<template>
  <div class="VonInput">
    <div class="label" v-if="label">{{label}}</div>
    <el-input
            v-if="isNumberInput"
            :placeholder="placeholder"
            oninput="value=value.replace(/[^\d]/g,'')"
            :style="customStyle"
            v-bind="$attrs"
            v-on="$listeners"
            size="small"
            clearable
            :show-password="showPassword"
            :suffix-icon="suffix?'el-icon-search':''">
    </el-input>
    <el-input
            v-if="!isNumberInput"
            :placeholder="placeholder"
            :style="customStyle"
            v-bind="$attrs"
            v-on="$listeners"
            size="small"
            clearable
            :show-password="showPassword"
            :suffix-icon="suffix?'el-icon-search':''">
    </el-input>
    <div v-if="!!append" :style="{color:'white',fontSize: '12px',marginLeft:'5px',marginRight:'10px'}">{{append}}</div>
  </div>
</template>

<script>
  export default {
    name: "VonInput",
    data() {
      return {

      }
    },
    props: {
      append:{
        type:String,
        default:''
      },
      isNumberInput:{
        type: Boolean,
        default: false
      },
      suffix: {
        type: Boolean,
        default: false
      },
      placeholder: {
        type: String,
        default: ''
      },
      showPassword: {
        type: Boolean,
        default: false,
      },
      width: {
        type: String,
        default: '300px'
      },
      height: {
        type: String,
        default: '44px'
      },
      label: {
        type: String,
        default: ''
      }
    },
    computed: {
      customStyle() {
        let styleObj = {};
        styleObj.width = this.width;
        styleObj.height = this.height;
        styleObj.lineHeight = this.height;
        return styleObj;
      }
    },
    methods:{
    }
  }
</script>

<style lang="scss">
  @import "../../style/various";

  .VonInput {
    margin: 10px 10px;
    width: 100%;

    .label {
      height: 20px;
      line-height: 20px;
      color: white;
      font-size: 16px;
    }

    .el-input {
      .el-input__inner {
        color: white !important;
        background: rgba(111, 117, 131, 0.3);
        padding: 0 4px;
        color: #1acc8f;
      }
    }
  }
</style>